Optimal. Leaf size=659 \[ -\frac{b \left (3 a^4 A b^3 \left (m^3-7 m^2+10 m+8\right )+3 a^2 A b^5 m \left (m^2-5 m+2\right )-a^6 A b \left (-m^3+9 m^2-26 m+24\right )-3 a^5 b^2 B \left (m^3-4 m^2-m+12\right )+3 a^3 b^4 B \left (-m^3+2 m^2+5 m+2\right )+a^7 B \left (-m^3+6 m^2-11 m+6\right )+a b^6 B m \left (1-m^2\right )+A b^7 m \left (m^2-3 m+2\right )\right ) \tan ^{m+1}(c+d x) \text{Hypergeometric2F1}\left (1,m+1,m+2,-\frac{b \tan (c+d x)}{a}\right )}{6 a^4 d (m+1) \left (a^2+b^2\right )^4}+\frac{\left (-6 a^2 A b^2+a^4 A+4 a^3 b B-4 a b^3 B+A b^4\right ) \tan ^{m+1}(c+d x) \text{Hypergeometric2F1}\left (1,\frac{m+1}{2},\frac{m+3}{2},-\tan ^2(c+d x)\right )}{d (m+1) \left (a^2+b^2\right )^4}-\frac{\left (4 a^3 A b+6 a^2 b^2 B+a^4 (-B)-4 a A b^3-b^4 B\right ) \tan ^{m+2}(c+d x) \text{Hypergeometric2F1}\left (1,\frac{m+2}{2},\frac{m+4}{2},-\tan ^2(c+d x)\right )}{d (m+2) \left (a^2+b^2\right )^4}+\frac{b \left (2 a^2 A b^3 \left (m^2-6 m+2\right )+a^4 A b \left (m^2-9 m+26\right )+2 a^3 b^2 B \left (-m^2+3 m+7\right )+a^5 (-B) \left (m^2-6 m+11\right )+a b^4 B \left (1-m^2\right )+A b^5 \left (m^2-3 m+2\right )\right ) \tan ^{m+1}(c+d x)}{6 a^3 d \left (a^2+b^2\right )^3 (a+b \tan (c+d x))}+\frac{b \left (a^2 A b (8-m)+a^3 (-B) (5-m)+a b^2 B (m+1)+A b^3 (2-m)\right ) \tan ^{m+1}(c+d x)}{6 a^2 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))^2}+\frac{b (A b-a B) \tan ^{m+1}(c+d x)}{3 a d \left (a^2+b^2\right ) (a+b \tan (c+d x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 2.44736, antiderivative size = 659, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.258, Rules used = {3609, 3649, 3653, 3538, 3476, 364, 3634, 64} \[ -\frac{b \left (3 a^4 A b^3 \left (m^3-7 m^2+10 m+8\right )+3 a^2 A b^5 m \left (m^2-5 m+2\right )-a^6 A b \left (-m^3+9 m^2-26 m+24\right )-3 a^5 b^2 B \left (m^3-4 m^2-m+12\right )+3 a^3 b^4 B \left (-m^3+2 m^2+5 m+2\right )+a^7 B \left (-m^3+6 m^2-11 m+6\right )+a b^6 B m \left (1-m^2\right )+A b^7 m \left (m^2-3 m+2\right )\right ) \tan ^{m+1}(c+d x) \, _2F_1\left (1,m+1;m+2;-\frac{b \tan (c+d x)}{a}\right )}{6 a^4 d (m+1) \left (a^2+b^2\right )^4}+\frac{\left (-6 a^2 A b^2+a^4 A+4 a^3 b B-4 a b^3 B+A b^4\right ) \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac{m+1}{2};\frac{m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1) \left (a^2+b^2\right )^4}-\frac{\left (4 a^3 A b+6 a^2 b^2 B+a^4 (-B)-4 a A b^3-b^4 B\right ) \tan ^{m+2}(c+d x) \, _2F_1\left (1,\frac{m+2}{2};\frac{m+4}{2};-\tan ^2(c+d x)\right )}{d (m+2) \left (a^2+b^2\right )^4}+\frac{b \left (2 a^2 A b^3 \left (m^2-6 m+2\right )+a^4 A b \left (m^2-9 m+26\right )+2 a^3 b^2 B \left (-m^2+3 m+7\right )+a^5 (-B) \left (m^2-6 m+11\right )+a b^4 B \left (1-m^2\right )+A b^5 \left (m^2-3 m+2\right )\right ) \tan ^{m+1}(c+d x)}{6 a^3 d \left (a^2+b^2\right )^3 (a+b \tan (c+d x))}+\frac{b \left (a^2 A b (8-m)+a^3 (-B) (5-m)+a b^2 B (m+1)+A b^3 (2-m)\right ) \tan ^{m+1}(c+d x)}{6 a^2 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))^2}+\frac{b (A b-a B) \tan ^{m+1}(c+d x)}{3 a d \left (a^2+b^2\right ) (a+b \tan (c+d x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3609
Rule 3649
Rule 3653
Rule 3538
Rule 3476
Rule 364
Rule 3634
Rule 64
Rubi steps
\begin{align*} \int \frac{\tan ^m(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^4} \, dx &=\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{\int \frac{\tan ^m(c+d x) \left (3 a^2 A+A b^2 (2-m)+a b B (1+m)-3 a (A b-a B) \tan (c+d x)+b (A b-a B) (2-m) \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^3} \, dx}{3 a \left (a^2+b^2\right )}\\ &=\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{b \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^{1+m}(c+d x)}{6 a^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac{\int \frac{\tan ^m(c+d x) \left (-a^2 b (A b-a B) (5-m) (1+m)+\left (2 a^2+b^2 (1-m)\right ) \left (3 a^2 A+A b^2 (2-m)+a b B (1+m)\right )-6 a^2 \left (2 a A b-a^2 B+b^2 B\right ) \tan (c+d x)+b (1-m) \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^2} \, dx}{6 a^2 \left (a^2+b^2\right )^2}\\ &=\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{b \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^{1+m}(c+d x)}{6 a^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac{b \left (a b^4 B \left (1-m^2\right )+2 a^3 b^2 B \left (7+3 m-m^2\right )+a^4 A b \left (26-9 m+m^2\right )+2 a^2 A b^3 \left (2-6 m+m^2\right )-a^5 B \left (11-6 m+m^2\right )+A b^5 \left (2-3 m+m^2\right )\right ) \tan ^{1+m}(c+d x)}{6 a^3 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}+\frac{\int \frac{\tan ^m(c+d x) \left (6 a^6 A-a b^5 B m \left (1-m^2\right )-2 a^2 A b^4 m \left (2-6 m+m^2\right )-A b^6 m \left (2-3 m+m^2\right )-2 a^3 b^3 B \left (3+7 m+3 m^2-m^3\right )-a^4 A b^2 \left (18+26 m-9 m^2+m^3\right )+a^5 b B \left (18+11 m-6 m^2+m^3\right )-6 a^3 \left (3 a^2 A b-A b^3-a^3 B+3 a b^2 B\right ) \tan (c+d x)-b m \left (a b^4 B \left (1-m^2\right )+2 a^3 b^2 B \left (7+3 m-m^2\right )+a^4 A b \left (26-9 m+m^2\right )+2 a^2 A b^3 \left (2-6 m+m^2\right )-a^5 B \left (11-6 m+m^2\right )+A b^5 \left (2-3 m+m^2\right )\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{6 a^3 \left (a^2+b^2\right )^3}\\ &=\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{b \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^{1+m}(c+d x)}{6 a^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac{b \left (a b^4 B \left (1-m^2\right )+2 a^3 b^2 B \left (7+3 m-m^2\right )+a^4 A b \left (26-9 m+m^2\right )+2 a^2 A b^3 \left (2-6 m+m^2\right )-a^5 B \left (11-6 m+m^2\right )+A b^5 \left (2-3 m+m^2\right )\right ) \tan ^{1+m}(c+d x)}{6 a^3 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}+\frac{\int \tan ^m(c+d x) \left (6 a^3 \left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right )-6 a^3 \left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \tan (c+d x)\right ) \, dx}{6 a^3 \left (a^2+b^2\right )^4}-\frac{\left (b \left (a b^6 B m \left (1-m^2\right )+3 a^2 A b^5 m \left (2-5 m+m^2\right )+A b^7 m \left (2-3 m+m^2\right )+3 a^3 b^4 B \left (2+5 m+2 m^2-m^3\right )+a^7 B \left (6-11 m+6 m^2-m^3\right )-a^6 A b \left (24-26 m+9 m^2-m^3\right )+3 a^4 A b^3 \left (8+10 m-7 m^2+m^3\right )-3 a^5 b^2 B \left (12-m-4 m^2+m^3\right )\right )\right ) \int \frac{\tan ^m(c+d x) \left (1+\tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{6 a^3 \left (a^2+b^2\right )^4}\\ &=\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{b \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^{1+m}(c+d x)}{6 a^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac{b \left (a b^4 B \left (1-m^2\right )+2 a^3 b^2 B \left (7+3 m-m^2\right )+a^4 A b \left (26-9 m+m^2\right )+2 a^2 A b^3 \left (2-6 m+m^2\right )-a^5 B \left (11-6 m+m^2\right )+A b^5 \left (2-3 m+m^2\right )\right ) \tan ^{1+m}(c+d x)}{6 a^3 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}+\frac{\left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right ) \int \tan ^m(c+d x) \, dx}{\left (a^2+b^2\right )^4}-\frac{\left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \int \tan ^{1+m}(c+d x) \, dx}{\left (a^2+b^2\right )^4}-\frac{\left (b \left (a b^6 B m \left (1-m^2\right )+3 a^2 A b^5 m \left (2-5 m+m^2\right )+A b^7 m \left (2-3 m+m^2\right )+3 a^3 b^4 B \left (2+5 m+2 m^2-m^3\right )+a^7 B \left (6-11 m+6 m^2-m^3\right )-a^6 A b \left (24-26 m+9 m^2-m^3\right )+3 a^4 A b^3 \left (8+10 m-7 m^2+m^3\right )-3 a^5 b^2 B \left (12-m-4 m^2+m^3\right )\right )\right ) \operatorname{Subst}\left (\int \frac{x^m}{a+b x} \, dx,x,\tan (c+d x)\right )}{6 a^3 \left (a^2+b^2\right )^4 d}\\ &=-\frac{b \left (a b^6 B m \left (1-m^2\right )+3 a^2 A b^5 m \left (2-5 m+m^2\right )+A b^7 m \left (2-3 m+m^2\right )+3 a^3 b^4 B \left (2+5 m+2 m^2-m^3\right )+a^7 B \left (6-11 m+6 m^2-m^3\right )-a^6 A b \left (24-26 m+9 m^2-m^3\right )+3 a^4 A b^3 \left (8+10 m-7 m^2+m^3\right )-3 a^5 b^2 B \left (12-m-4 m^2+m^3\right )\right ) \, _2F_1\left (1,1+m;2+m;-\frac{b \tan (c+d x)}{a}\right ) \tan ^{1+m}(c+d x)}{6 a^4 \left (a^2+b^2\right )^4 d (1+m)}+\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{b \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^{1+m}(c+d x)}{6 a^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac{b \left (a b^4 B \left (1-m^2\right )+2 a^3 b^2 B \left (7+3 m-m^2\right )+a^4 A b \left (26-9 m+m^2\right )+2 a^2 A b^3 \left (2-6 m+m^2\right )-a^5 B \left (11-6 m+m^2\right )+A b^5 \left (2-3 m+m^2\right )\right ) \tan ^{1+m}(c+d x)}{6 a^3 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}+\frac{\left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right ) \operatorname{Subst}\left (\int \frac{x^m}{1+x^2} \, dx,x,\tan (c+d x)\right )}{\left (a^2+b^2\right )^4 d}-\frac{\left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \operatorname{Subst}\left (\int \frac{x^{1+m}}{1+x^2} \, dx,x,\tan (c+d x)\right )}{\left (a^2+b^2\right )^4 d}\\ &=\frac{\left (a^4 A-6 a^2 A b^2+A b^4+4 a^3 b B-4 a b^3 B\right ) \, _2F_1\left (1,\frac{1+m}{2};\frac{3+m}{2};-\tan ^2(c+d x)\right ) \tan ^{1+m}(c+d x)}{\left (a^2+b^2\right )^4 d (1+m)}-\frac{b \left (a b^6 B m \left (1-m^2\right )+3 a^2 A b^5 m \left (2-5 m+m^2\right )+A b^7 m \left (2-3 m+m^2\right )+3 a^3 b^4 B \left (2+5 m+2 m^2-m^3\right )+a^7 B \left (6-11 m+6 m^2-m^3\right )-a^6 A b \left (24-26 m+9 m^2-m^3\right )+3 a^4 A b^3 \left (8+10 m-7 m^2+m^3\right )-3 a^5 b^2 B \left (12-m-4 m^2+m^3\right )\right ) \, _2F_1\left (1,1+m;2+m;-\frac{b \tan (c+d x)}{a}\right ) \tan ^{1+m}(c+d x)}{6 a^4 \left (a^2+b^2\right )^4 d (1+m)}-\frac{\left (4 a^3 A b-4 a A b^3-a^4 B+6 a^2 b^2 B-b^4 B\right ) \, _2F_1\left (1,\frac{2+m}{2};\frac{4+m}{2};-\tan ^2(c+d x)\right ) \tan ^{2+m}(c+d x)}{\left (a^2+b^2\right )^4 d (2+m)}+\frac{b (A b-a B) \tan ^{1+m}(c+d x)}{3 a \left (a^2+b^2\right ) d (a+b \tan (c+d x))^3}+\frac{b \left (A b^3 (2-m)-a^3 B (5-m)+a^2 A b (8-m)+a b^2 B (1+m)\right ) \tan ^{1+m}(c+d x)}{6 a^2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac{b \left (a b^4 B \left (1-m^2\right )+2 a^3 b^2 B \left (7+3 m-m^2\right )+a^4 A b \left (26-9 m+m^2\right )+2 a^2 A b^3 \left (2-6 m+m^2\right )-a^5 B \left (11-6 m+m^2\right )+A b^5 \left (2-3 m+m^2\right )\right ) \tan ^{1+m}(c+d x)}{6 a^3 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))}\\ \end{align*}
Mathematica [B] time = 6.2787, size = 1901, normalized size = 2.88 \[ \text{result too large to display} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.633, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{m} \left ( A+B\tan \left ( dx+c \right ) \right ) }{ \left ( a+b\tan \left ( dx+c \right ) \right ) ^{4}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \tan \left (d x + c\right )^{m}}{{\left (b \tan \left (d x + c\right ) + a\right )}^{4}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left (B \tan \left (d x + c\right ) + A\right )} \tan \left (d x + c\right )^{m}}{b^{4} \tan \left (d x + c\right )^{4} + 4 \, a b^{3} \tan \left (d x + c\right )^{3} + 6 \, a^{2} b^{2} \tan \left (d x + c\right )^{2} + 4 \, a^{3} b \tan \left (d x + c\right ) + a^{4}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \tan \left (d x + c\right )^{m}}{{\left (b \tan \left (d x + c\right ) + a\right )}^{4}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]